package com.cloud.order.mapper.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
* (Coupon) 实体类
*
* @author zhangxun
* @since 2021-01-17
*/
@Data
@TableName(value = "coupon")
public class Coupon implements Serializable {
    private static final long serialVersionUID=1L;
    /*** 优惠券id*/
    @TableId(type = IdType.AUTO)
    private Long couponId;

    /*** 优惠券金额*/
    @TableField("coupon_price")
    private BigDecimal couponPrice;

    /*** 用户id*/
    @TableField("user_id")
    private Long userId;

    /*** 订单id*/
    @TableField("order_id")
    private Long orderId;

    /*** 0 未使用，1已使用*/
    @TableField("used")
    private Integer used;

    /*** 使用时间*/
    @TableField("user_time")
    @JsonFormat(shape= JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime userTime;

}